import Request from '@/utils/request'

/**
 * 通过code获取微信用户openId和accessToken
 * @param {String} wxcode
 * @returns {AxiosInstance}
 */
export function getWxUserInfo (wxCode) {
  return new Request({
    url: 'sapi/wxapi/getWxUserInfo',
    method: 'post',
    data: {
      code: wxCode
    }
  })
}

/**
 * 获取用户信息
 * @param {Object} wxCode
 */
export function getCurUserInfo (wxCode) {
  return new Request({
    url: 'sapi/wxapi/getCurUserInfo',
    method: 'get',
    params: {
      code: wxCode
    }
  })
}
